<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=<device-width>, initial-scale=1.0" />
    <title>Document</title>
</head>

<body>
    <div class="grid">
        <button>按钮1</button>
        <button>按钮2</button>
        <button>
            按钮3网格布局能直接控制HTML文档中元素的顺序、位置和大小等，而不用再借助辅助元素。
        </button>
        <button style="justify-self: end">按钮4</button>
    </div>
    <style>
        .grid {
            display: grid;
            justify-items: center;
            align-items: center;
            grid-template-columns: repeat(auto-fit, 200px);
            grid-auto-rows: 1fr;
            gap: 16px;
            justify-content: space-around;
        }

        button {
            width: 100px;
        }
    </style>
</body>

</html>